<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page trimDirectiveWhitespaces="true"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>

<c:set var="ctx" value="${pageContext.request.contextPath}" />


<div id="main-content">
	<form class="coupon-form" id="chooseUser-form">
		<table>
			<tr>
				<td style="font-size:16px"><b>筛选用户：</b></td>
			</tr>
			<tr>
				<td>注册时间:</td>
				<td ><input id="startTime1" style='width: 200px;' readonly size="16" type="text" 
						name="registDateStart" class="form_datetime form-control required start_date"><span style="margin: 0 10px;">至</span>
						<input id="endTime1" style='width: 200px;' readonly size="16" type="text" name="registDateEnd" class="form_datetime form-control required end_date">
						<span style="color:red;">&nbsp;*</span>
				</td>
			</tr>
			<tr>
				<td>消费时间:</td>
				<td class="datepick-td"><input id="startTime2" style='width: 200px;' readonly size="16" type="text" 
						name="comsumptionDateStart" class="form_datetime form-control required start_date"><span style="margin: 0 10px;">至</span>
						<input id="endTime2" style='width: 200px;' readonly size="16" type="text" name="comsumptionDateEnd" class="form_datetime form-control required end_date">
						<span style="color:red;">&nbsp;*</span>
				</td>
			</tr>
			<tr>
				<td>单次消费最低金额：</td>
				<td><input type="text" name="comsumptionFee" class="price" >&nbsp元</td>
			</tr>
			<tr>
				<td>总消费最低金额：</td>
				<td><input type="text" name="comsumptionTotleFee" class="price" >&nbsp元</td>
			</tr>
			<tr>
				<td>参加过的服务类型：</td>
				<td id="join-project">
						<!-- <select  id="join-project"  style="width:300px;" name="projectCategory">

						</select> -->
						<input  type="checkbox" name="projectCategory0" value="0" style="margin:0;">全选/全不选
				</td>
			</tr>
			<tr>
				<td>&nbsp;</td>
				<td><p>（提示：选择类型后，该类型下的所有服务将被选中）</p></td>
			</tr>
			<tr><td>&nbsp;</td></tr>
			<tr>
				<td>选择服务：</td>
				<td>
					<!-- <select id="coupon-project" style="width:300px;" name="project.id">
						<option value="0" >选择服务</option>
					</select> -->
					<a id="add-project" class="btn-link" data-toggle="modal" data-target="#upModal" >添加</a>
				</td>
			</tr>
			<tr><td>&nbsp;</td></tr>
			<tr>
				<td>
				<div>				
					<button  class="btn btn-primary addto-address" id="chooseUser">筛选用户</button>
				</div>
				</td>
			</tr>
			<tr><td>&nbsp;</td></tr>
		</table>
	</form>
	<form class="coupon-form" id="coupon-provide-form">
		<table>
			<tr>
				<td style="font-size:16px"><b>派发优惠券:</b></td>
			</tr>
			
			<tr>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td>已选择用户：</td>
				<td id="chosenUser"></td>
			</tr>
			<tr>
				<td>&nbsp;</td>
			</tr>
			<!-- <tr>
				<td>每位用户派发张数：</td>
				<td><input type="text" value="1" placeholder="1" style="width:20px;"></td>
			</tr> -->
			<tr>
				<td>选择优惠券类型：</td>
				<td>
					<div id="coupon-type">
						<select style="width:300px;" name="label" class="required">
							<option value=''>选择优惠券类型</option>
							<option value="money">现金券</option>
							<option value="goods">实物券</option>
							<option value="activity">虚拟券</option>
						</select>
					</div>
					
				</td>
			</tr>
			<tr>
				<td>优惠券简介：</td>
				<td><textarea  class="required" id="couponexplain" type="textarea" name="couponExplain" style="width:100%;height:100px"></textarea></td>
			</tr>
			<tr>
				<td>优惠券价值：</td>
				<td>
						<input type="text" id="couponvalue" name="couponValue" class="price  required " style="width:300px;">&nbsp<b>元</b>
						<span id="couvalue" style="color:red;display:none;">&nbsp *必须为数字</span>
				</td>
			</tr>
			<tr>
				<td>过期时间:</td>
				<td><input type="text" id="overduateDate" readonly class="required " name="overdueDate" style="width:300px;"></td>
			</tr>
			<tr>
				<td>
				<div>				
					<button  class="btn btn-primary addto-address" id="sent">派发</button>
				</div>
				</td>
			</tr>
		</table>
	</form>
</div>


<!-- 添加服务弹出框 -->
<div id="upModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-header" style="height:30px;">
			<button type="button" class="close" data-dismiss="modal"
				aria-hidden="true">×</button>
			<h4 style="margin: 0px;padding:5px 0;" id="myModalLabel" >添加服务</h4>
	</div>
	<div class="modal-body " id="coupon-project">

	</div>
	<div class="modal-footer">
		<div class="pull-left subtn">
			<button type="button" class="btn btn-primary addto-address" id="add-submit">添加</button>
		</div>
	</div>
</div>

<!-- 服务分类模板 -->
<script type="text/html" id="peojectFl-template">
	<$for(var i=0;i<projectCategories.length;i++){$>
		<input type="checkbox" name="projectCategory<$=i+1$>" value="<$=projectCategories[i].id$>" style="margin:0;"><$=projectCategories[i].categoryName$>
	<$}$>
</script>





<c:if test="${env == 'production' }">
	<script type="text/javascript">
		seajs.use("${ctx}/assets/js-dist/admin/coupon-provide-page");
	</script>
</c:if>
<c:if test="${env != 'production' }">
	<script type="text/javascript">
		seajs.use("${ctx}/assets/js/admin/coupon-provide-page");
	</script>
</c:if>